import time

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

if __name__ == '__main__':
    url = "http://www.baidu.com"

    executable_path = "../drivers/chromedriver.exe"

    service = Service(executable_path=executable_path)
    browser = webdriver.Chrome(service=service)

    browser.get(url=url)
    # 睡眠 10 秒，然后继续

    # 获取窗口页面标题
    title = browser.title
    print(title)

    # 获取窗口页面的源代码
    page = browser.page_source
    print(page)

    browser.quit()
